home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / cug202 / ked.h < prev    next >
Text File  |  1979-12-31  |  2KB  |  73 lines

  1. /* global constants */
  2.  
  3. #define MAXCOMM   30          /* number of valid edit commands */
  4. #define MAXTEST   19          /* number of booleans for Karel */
  5. #define MAXNAME   12          /* number of reserved commands */
  6. #define MAXLINE   150         /* number of lines */
  7. #define NOMATCH   -1          /* search for valid command fails */
  8. #define TEST       2          /* frequently referenced commands */
  9. #define POSINT     3     
  10. #define NEWINSTR   4
  11. #define BEG        5
  12. #define BEPGM      6
  13. #define BX         7
  14. #define ND         8
  15. #define NDX        9
  16. #define NDC       10
  17. #define IFF       11
  18. #define THEN      12
  19. #define ELS       13
  20. #define DEF       16
  21. #define MENU      18
  22. #define ERROR     -1
  23. #define CPMEOF   0X1A
  24.  
  25. /* global constants included in the standard library
  26.  
  27. BUFSIZ
  28. EOF
  29. FILE
  30. NULL  
  31.  
  32. */
  33.  
  34. /* global variables */
  35.  
  36. FILE *fptr1;                  /* input file pointer for sparse tree */
  37. FILE *fptr2;                  /* output file ptp for text */
  38. char *comm[MAXCOMM];          /* valid editor commands */
  39. char *test[MAXTEST];          /* booleans for Karel's pgm */
  40. char *iname[MAXNAME];         /* commands for Karel's pgm */
  41. int insert;                   /* boolean for inserting new node */
  42. int ins;                      /* final indent level */
  43. struct tnode {                /* node for parse tree */
  44.      int instr;               /* stored instruction */
  45.      int indent;              /* used for pretty printing */
  46.      int del;                 /* can node be deleted */
  47.      int nfollow;             /* valid next follow statements */
  48.      int sfollow;             /* valid component followers */
  49.      int comp;
  50.      int cons;
  51.      int lastin;
  52.      struct tnode *prev;
  53.      struct tnode *prec;
  54.      struct tnode *next;
  55.      struct tnode *sub;
  56. };
  57. struct tnode *root;
  58. struct tnode *p;
  59. struct tnode *pr;
  60. struct tnode *curr;
  61. struct tnode *temp;
  62. struct tnode *endof;
  63. struct tnode *insertnode;
  64. struct tnode *tempend;
  65. struct deftable {
  66.      char defname[MAXLINE];
  67.      int nextin;
  68.      struct tnode *loc[15];
  69. } new[15];
  70. int first;
  71. int last;
  72. int reloc[15];
  73.